#include <iostream>
#include <JXQCore/JMeta>
#include <JXQCore/JDebug>
#include <JXQCore/JThread>

int main(int argc, char *argv[])
{
	J_UNUSED(argc);
	J_UNUSED(argv);

	JXQ::JMeta::invokeNoBlock<void>("A::func2");

	JXQ::JThread::msleep(500);

	void *a = JXQ::JMeta::newObject("A");
	jDebug() << "jjjjjjj" << a;
	JXQ::JMeta::invoke<void>(a, "A", "func");
    JXQ::JMeta::invoke<void, const JXQ::JString&, int>(a, "A", "func1", "111", 12);
	JXQ::JMeta::deleteObject("A", a);

	JXQ::JMeta::invoke<void>(a, "B", "func"); // invoke fail: class B not register

	JXQ::JString str = "14";
	JXQ::JMeta::invoke<void, JXQ::JString>("func1_1", str);

	JXQ::JMeta::invoke<void, const JXQ::JString&>("func3", "36");

	jDebug() << JXQ::JMeta::funcTypeName(JXQ::JMeta::getTypeId("A"), "func");
	jDebug() << JXQ::JMeta::funcTypeName(JXQ::JMeta::getTypeId("A"), "func1");
	jDebug() << JXQ::JMeta::funcTypeName("A::func2");
	jDebug() << JXQ::JMeta::funcTypeName("func1_1");
	jDebug() << JXQ::JMeta::funcTypeName("func3");

	return 0;
}
